package com.stx.system;

public class TestSys {
    public static void main(String[] args) {
        // 默认初始化5条数据
        DB.studentList.add(new Student("10001", "Jason Zhang", "男", 22, "四川成都", 100, "吃饭,睡觉,打豆豆", "13812345678"));
        DB.studentList.add(new Student("10004", "Messi", "男", 19, "罗萨里奥", 99, "打麻将,吃瓜,吹牛逼", "14787654321"));
        DB.studentList.add(new Student("10003", "Ding jun hui", "男", 18, "江苏宜兴", 90, "健身,撩妹,吃棒棒糖", "18123456789"));
        DB.studentList.add(new Student("10002", "渣渣辉", "男", 18, "香港", 59, "发音不标准,吃饭,打棒球", "15212345679"));
        DB.studentList.add(new Student("10008", "古巨基", "男", 28, "香港", 59, "吹牛逼,吃饭,打棒球", "15212345679"));

        //调用打印欢迎菜单
        Display.showWelcome();
        while (true) {
            //调用打印选择菜单
            int choose = Display.showChooseMenu();
            switch (choose) {
                case 1:
                    //查询all学生
                    StudentService.queryAllStudents();
                    break;
                case 2:
                    //新增学生方法
                    StudentService.addStudent();
                    break;
                case 3:
                    //根据ID查询学生
                    StudentService.queryStudentById();
                    break;
                case 4:
                    //根据姓名查询学生
                    StudentService.queryStudentByName();
                    break;
                case 5:
                    // 更新学生信息
                    StudentService.updateStudentById();
                    break;
                case 6:
                    //删除学生信息
                    StudentService.deleteStudentById();
                    break;
                case 7:
                    // 删除全部学生信息
                    StudentService.deleteAllStudents();
                    break;
                case 8:
                    // 根据学生成绩排序
                    StudentService.scoreSort();
                    break;
                case 9:
                    // 打印不及格学生名单
                    StudentService.scoreFailMenu();
                    break;
                case 0:
                    //打印结束菜单,并退出系统
                    Display.showBye();
                    System.exit(0);
                    break;
                default:
                    System.out.println("选项超出范围`，请重试~~");
            }
        }
    }
}
